def linear_search(numLi:list[int],num:int):
    for index , val in enumerate(numLi):
        if val == num:
            return index
    return None

def bin_search(numLi:list[int], num:int):
    left = 0;right = len(numLi) - 1 
    mid = (left + right) // 2
    while(left <= right):
        if numLi[mid] < num:
            left = mid + 1
            mid = (left + right) // 2
        elif numLi[mid] > num:
            right = mid - 1
            mid = (left + right) // 2
        else :
            return mid
    return None


if __name__ == "__main__":

    a = [i for i in range(1,10)]
    
    print(linear_search(a,7))
    print(bin_search(a,7))
    
    pass
